/*
 * String.prototype.repeat( count )
 * String.prototype.padEnd( targetLength [, padString] )
 * String.prototype.padStart( targetLength [, padString] )
 * 
 * 字符串可以使用 > 、< 、== 、!= 、>= 、<= 、=== 、!== 等运算符来比较
 * String.prototype.localeCompare() 比较当前字符串是否小于、等于、大于指定字符串，
 *                                  当当前字符串小于、等于、大于指定字符串时分别返回 -1 、0 、 1
 */

let origin = '- - - ' ;
let line = origin.repeat( 10 );

console.log( line );

let salary = '9999元' ;
let ps = salary.padStart( 8, '0' );
console.log( ps );

let binary = '1001011' ;
let bin = binary.padStart( 32 , '0' );
console.log( bin );

let time = '23.456' ;
let ms = time.padEnd( 12 , '0' ) ;
console.log( ms );

console.log( line );

let first = 'abc' ;
let second = 'xyz' ;

console.log( first < second ); // true
// 返回 -1 表示 first 小于 second
// 返回  0 表示 first 等于 second
// 返回  1 表示 first 大于 second
console.log( first.localeCompare( second ) );

let third = '赵娅婷' ;
let fourth = '赵亚红' ;

console.log( third < fourth ); // false
console.log( third.localeCompare( fourth ) );